<%@ page language="java"
	import="java.util.*,com.icss.beans.*,com.icss.daos.ArticleDao"
	pageEncoding="UTF-8"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>updateArticle</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

</head>
<div align="center">
<body>
<jsp:useBean id="articledao" class="com.icss.daos.ArticleDao"></jsp:useBean>
<%
				ArticleVO vo = null;
				Object pid = session.getAttribute("pid");
				if (pid == null || (Integer) pid == 1) {
			%>

<script>alert('你不是论坛管理员！无权此操作！');location.href='javascript:history.go(-1)'</script>
<%
					} else {

					int aid = Integer.parseInt(request.getParameter("aid"));
					vo = articledao.getArticleById(aid);
					articledao.close();
			%>

<!-- fckeditor -->
<script type="text/javascript" src="BBS/fckeditor/fckeditor.js"></script>
<script type="text/javascript">

window.onload = function()
{
	// Automatically calculates the editor base path based on the _samples directory.
	// This is usefull only for these samples. A real application should use something like this:
	// oFCKeditor.BasePath = '/fckeditor/' ;	// '/fckeditor/' is the default value.
	// var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('_samples')) ;
	var sBasePath = "<%=request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
						+ request.getContextPath() + "/BBS/fckeditor/"%>"
    //alert(sBasePath);
	var oFCKeditor = new FCKeditor( "articlebody" ) ;
	oFCKeditor.BasePath	= sBasePath ;
	oFCKeditor.ReplaceTextarea() ;
}

</script>
<!-- end of fckeditor -->

<form action="<%=basePath%>bbsDealServlet?param=updateArticle"
	method="post">
<h2>修改文章</h2>
<hr>



文章编号： <input type="text" name="aid" value="<%=vo.getAid()%>" readonly>

<br>
<br>


文章名称： <input type="text" name="articleName"
	value="<%=vo.getArticleName()%>"> <br>
<br>


文章作者： <input type="text" name="author" value="<%=vo.getAuthorName()%>"
	readonly> <br>
<br>


文章内容： <br>

<textarea name="articlebody" rows="15" cols="40">
					<%=vo.getArticleBody()%>
				</textarea> <br>
<br>


<input type="submit" value="修改成功"> &nbsp;&nbsp; <input
	type="reset" value="重写"></form>

<%
			}
			%>
</body>
</div>
</html>
